<script type="text/javascript">
$(document).ready(function(){
	//Administry.setup();
	//Administry.expandableRows();
});
function del(id){
	if(confirm("是否确定删除？")){
		$.ajax({
			url:'/admin_channel/appdel',
			type:'POST',
			data:{id:id},
			success:function(msg)
			{
				msg = msg.split(':');
				if(msg['0']=='100'){
					alert(msg['1']);
					window.location.reload(); 
				}else{
					alert(msg['1']);
				}

			}

		})
	}
}
function edit(id)
{
	if(confirm("是否确定编辑？"))
	{
		location.href="/admin_channel/appedit/id/"+id;
	}
}
function review(id)
{
	if(confirm("是否确定审核？"))
	{
		location.href="/admin_project/review/id/"+id;
	}
}
</script>

	<!-- Page content -->
	<div id="page">
		
		<!-- Wrapper -->
		<div class="wrapper" >
                    <?php if(isset($_SESSION['message'])&&$_SESSION['message']){
                        echo 
                        "<div id=\"message\"  style=\"width:99%;\" class=\" box\">
                    	{$_SESSION['message']}					
                         </div>
                         <script>
                         $('#message').fadeIn(1000); 
                         $('#message').fadeOut(1000); 
                         $('#message').fadeIn(1000); 
                         $('#message').fadeOut(1000);
                         $('#message').fadeIn(1000); 
                         $('#message').fadeOut(1000);
                        </script>
                        ";
                    }
                            $_SESSION['message'] = '';
                    ?>
                    
             
				<h3>渠道列表</h3>
				<!--<span class="subtitle">所有渠道：</span>-->
				<hr>
				<div id="tabs" class="ui-tabs">
					<ul class="ui-tabs-nav">
						<li ><a class="corner-tl" href="/admin_channel/index">渠道列表</a></li>
						<li><a class="corner-tr" href="/admin_channel/addchannel">添加渠道</a></li>
                                                <li class='ui-tabs-selected'><a class="corner-tr" href="/admin_channel/appindex">APP列表</a></li>
                                                <li><a class="corner-tr" href="/admin_channel/addapp">添加APP</a></li>
					</ul>
					<div id="tabs-1" class="ui-tabs-panel">
						<div class="box" align="right" style="width:98.5%;">
							<form action="" method="POST">
								关键字：<input name="keyword" type="text" id="keyword" size="25" maxlength="30" class="text" value="">
								<input name="search" type="submit" class="btn btn-green" id="search" value=" 搜索 " />
							</form>
						</div>                                            
						<table id="report" class="stylized full" style="">
							<thead>
								<tr>
                                                                        <th style="width: 30%">APP_ID</th>
									<th style="width: 30%">渠道名称</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								<?php 
                                                                if($this->info_list){
								foreach($this->info_list as $key=>$value)
								{
                                                                    
								echo "<tr>".
									"<td>".$value['key']."</td>".
                                                                        "<td>".$value['val']."</td>".
									"<td>".
											"
											<a href='javascript:;' onclick=edit('".$value['key']."')>编辑</a>&nbsp;
											<a href='javascript:;' onclick=del('".$value['key']."')>删除</a>".
									"</td>".
								"</tr>";								
							     }
                                                                }
								 ?>
							</tbody>
                                                        <thead>
								<tr>
                                                                    <td>
									<a href="/admin_channel/appindex/page/<?php echo $page - 1 > 0? $page - 1: 1; ?>">上一页</a>
                                                                    </td>
                                                                    <td>
                                                                        <a href="/admin_channel/appindex/page/<?php echo $page + 1 < $pnum? $page + 1: $pnum; ?>">下一页</a>
                                                                    </td>
                                                                    <td>
                                                                        
                                                                    </td>
                                                                    
								</tr>
							</thead>
						</table>
					</div>
					<div class="clear">&nbsp;</div>
				</div>
		</div>
		<!-- End of Wrapper -->
		
	</div>
<!-- End of Page content -->